package edu.zut.filter;

import javax.servlet.*;
import javax.servlet.annotation.*;
import java.io.IOException;

public class FilterDemo3 implements Filter {
    public void init(FilterConfig config) throws ServletException {
        System.out.println("filter3初始化......");
    }

    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        System.out.println("filter3執行.......");
        //拦截的话，可以使用重定向或转发跳转到对应拦截后的资源
        chain.doFilter(request, response);
    }
}
